<%@ page language="java" import="java.util.*" pageEncoding="utf-8"%>
<%@ taglib prefix="c" uri="http://java.sun.com/jsp/jstl/core"%>

<div class="easyui-layout" style="width: 100%; height: 100%;" fit="true">
	<div data-options="region:'center',split:true"
		style="width: 100%; height: 100%">
		<table id="tableGrid"></table>
	</div>
</div>
<script>
	var tbl;
	
	$(function() {
		initList(<%=request.getParameter("typeId")%>)
		
	});

	function initList(typeId) {
		
		params = {};
		params.typeId = typeId;
		tbl = $('#tableGrid').treegrid(
						{
							toolbar : '#toolbar',
							columns : [ [
									{
										field : 'name',
										title : '分类名称',
										width : 400
									},
									{
										title : '操作',
										field : 'action',
										width : '80',
										align : 'center',
										formatter : function(value, row) {
											var str = '';
											str += ' <a href="list.jsp?typeId='+<%=request.getParameter("typeId")%>+'&newsTypeId='+ row.newsTypeId+'"><img class="iconImg ext-icon-note_edit" title="进入"/></a>';
											return str;
										}
									} ] ],
							url : '<c:url value="/newstype/searchEmBNewsTypeByParentId.do"/>',
							queryParams:params,
							fitColumns : false,
							singleSelect : true,
							idField : 'id',
							treeField : 'name',
							collapsible : true,
							completeCallback : function(data) {
								if (data.resultCode == "100") {
									alertError(data.errorMsg);
								}
								
							}
						});
	}

 
</script>
